package global

import (
	"gin-canteen-src/config"
	"gin-canteen-src/utils/timer"
	"github.com/go-redis/redis/v8"
	"github.com/songzhibin97/gkit/cache/local_cache"
	"github.com/spf13/viper"
	"go.uber.org/zap"
	"golang.org/x/sync/singleflight"
	"gorm.io/gorm"
	"sync"
)

var (
	GloMysql  *gorm.DB
	GloRedis  *redis.Client
	GloConfig config.Server
	GloTimer  timer.Timer = timer.NewTimerTask()
	GloLock   sync.RWMutex

	GloLogger     *zap.Logger
	GloViper      *viper.Viper
	GloLocalCache local_cache.Cache

	GloConcurrencyControl = &singleflight.Group{}
)
